﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;


namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        string EQID = "000";
        string EQName = "";
        string EQType = "";
        string EQFnr = "";
        string EQFac = "";
        string BuyDate = "";
        string Dept = "";
        string loc = "";
        
      
        protected void Page_Load(object sender, EventArgs e)
        {
            EQID = Request["i"].Trim().ToString();
            //((System.Web.UI.HtmlControls.HtmlInputText)this.Form.FindControl("xxx")).Value = "fffff";
            DBS md = new DBS();

            DataSet ds = md.EQInfo_By_ID(EQID);
            if (ds.Tables[0].Rows.Count > 0)
            {
                EQName = ds.Tables[0].Rows[0][0].ToString();
                EQType = ds.Tables[0].Rows[0][1].ToString();
                EQFnr = ds.Tables[0].Rows[0][2].ToString();
                EQFac = ds.Tables[0].Rows[0][3].ToString();
                BuyDate = ds.Tables[0].Rows[0][4].ToString();
                Dept = ds.Tables[0].Rows[0][9].ToString()+" "+ds.Tables[0].Rows[0][5].ToString();
                loc = ds.Tables[0].Rows[0][8].ToString();


            }
            else

                Response.Redirect("http://www.cmuam.site/NoEQ.aspx"
                , false);
                

        }
        protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
        {

        }
        public string Getloc()
        {
            return loc;
            //////


        }
        public string GetEQName()
        {
            return EQName;
            //////


        }
        public string GetEQID()
        {
            return EQID;
            //////


        }
        public string GetEQType()
        {
            return EQType;
            //////


        }
        public string GetEQFnr()
        {
            return EQFnr;
            //////


        }
        public string GetEQFac()
        {
            return EQFac;
            //////


        }
        public string GetBuyDate()
        {
            return BuyDate;
            //////


        }

        public string GetDept()
        {
            return Dept;
            //////


        }
  
        protected void Button1_Click(object sender, EventArgs e)
        {
            //((System.Web.UI.HtmlControls.HtmlInputText)this.Form.FindControl("asd")).Value = ((System.Web.UI.HtmlControls.HtmlInputText)this.Form.FindControl("xxx")).Value;

        }


        protected void Button2_Click(object sender, EventArgs e)
        {
           
           

            string httpUrl =
               "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8579b2dae40753d2&redirect_uri=http://cmu.lichuanjia.cn/Add_RP_No_Code.aspx?eqid=" + EQID + "&response_type=code&scope=snsapi_base&state=";
            Response.Redirect(httpUrl); Response.Redirect(httpUrl);
             Response.Redirect(httpUrl);
            
        }

      

      

        protected void Button4_Click1(object sender, EventArgs e)
        {
            Response.Redirect("http://www.cmuam.site/EQ_Task_History.aspx?i=" + EQID
       , false);
        }
    }
}